local L = VisualThemes:GetLocaleTable()

VisualThemes:RegisterAddOnFunc("Bagnon", function(self)
	self:Hook(BagnonFrame, "Create", function(obj, ...)
		local frame = self.hooks[obj].Create(obj, ...)
		frame:Hide()
		self:RegisterFrames(L["Bagnon"], 0, frame:GetName())
		frame:Show()
		return frame
	end)
	self:Hook(BagnonMenu, "Show", function(obj, ...)
		self.hooks[obj].Show(obj, ...)
		local frame = obj.frame
		if frame then
			frame:Hide()
			self:RegisterFrames(L["Bagnon"], 0, frame) --can't use global name because its the same as a Bagnon class (which is not good imo!)
			frame:Show()
			self:Unhook(BagnonMenu, "Show")
		end
	end)
end)


